import Vue from 'vue'
import axios from 'axios'
import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // a modern alternative to CSS resets

import Element from 'element-ui'
import './assets/styles/element-variables.scss'

//百度编辑器
// import '@/assets/ueditor/ueditor.config.js'
// import '@/assets/ueditor/ueditor.all.js'
// import '@/assets/ueditor/lang/zh-cn/zh-cn.js'
// import '@/assets/ueditor/ueditor.parse.js'


import '@/assets/styles/index.scss' // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css
import App from './App'
import store from './store'
import router from './router'
import permission from './directive/permission'
import { toFixed2 } from '@/utils/index'
import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config";
import { parseTime, resetForm, addDateRange, selectDictLabel, download,downloadResource, handleTree,getBaseUrl } from "@/utils/ruoyi";
import Pagination from "@/components/Pagination";
import {getMassageCount, getCount} from "@/utils/massage"


// 图片组件
import zkImage from '@/components/zkImage'

//地区省市区县
import VDistpicker from '@/components/v-distpicker'

// 富文本组件
import Editor from "@/components/Editor"

// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.download = download
Vue.prototype.downloadResource = downloadResource
Vue.prototype.handleTree = handleTree
Vue.prototype.getBaseUrl = getBaseUrl
Vue.prototype.getMassageCount = getMassageCount
Vue.prototype.getCount = getCount
Vue.prototype.toFixed2 = toFixed2
Vue.prototype.$axios = axios

Vue.prototype.msgSuccess = function (msg) {
  this.$message({ showClose: true, message: msg, type: "success" });
}

Vue.prototype.msgError = function (msg) {
  this.$message({ showClose: true, message: msg, type: "error" });
}

Vue.prototype.msgInfo = function (msg) {
  this.$message.info(msg);
}

// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('v-distpicker',VDistpicker)
Vue.component('Editor', Editor)
Vue.component('zk-image', zkImage)
Vue.use(permission)

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */
//全局修改默认配置
Element.Dialog.props.closeOnClickModal.default=false;

Vue.use(Element, {
  size: Cookies.get('size') || 'medium' // set element-ui default size
})

import BaiduMap from 'vue-baidu-map'

Vue.use(BaiduMap, {
  ak: '33B192o1jPaqOHASGGAIkoMuwi8W76j3'  //  在此输入你自己的百度地图ak
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  axios,
  render: h => h(App)
})
